import NProgress from 'nprogress'
import { type PluginModule } from '~/types/plugins'
export const install = ({ isClient, router }: PluginModule) => {
  if (isClient) {
    router.beforeEach((to, from) => {
      if (to.path !== from.path) NProgress.start()
    })
    router.afterEach(() => {
      NProgress.done()
    })
  }
}
